Microsoft DirectX 8.1 (C++)

CBaseObject::CBaseObject

Constructor method.

Syntax

CBaseObject(
    const TCHAR *pName
);

Parameters

pName

String that contains the name of the object, for debugging purposes.

Remarks

This method increments the active-object count. (See CBaseObject::ObjectsActive.)

Allocate the pName parameter in static memory:

// Correct.
CBaseObject *pObject = new CBaseObject(NAME("My Object"));

// Incorrect.
TCHAR ObjectName[] = TEXT("My Object");
CBaseObject *pObject = new CObject(ObjectName);

The NAME macro compiles to NULL in retail builds, so that static strings appear only in debug builds. For more information, see DbgDumpObjectRegister.

See Also